package com.feng.openFeignPlus.register;

import java.lang.reflect.Method;
import java.util.List;

/**
 * 每个方法一个definition
 */
public class HandlerDefinition {

    /**
     * 处理器bean名称 优先会去@Service("")或@Component("")内的名称，找不到会用类名
     * 需要确保容器里有这个bean
     */
    private String handlerName;

    /**
     * 使用了factory注解的类
     */
    private Class<?> factoryClass;

    /**
     * 方法
     */
    private Method method;

    /**
     * 方法的参数列表
     */
    private List<Class<?>> paramsTypeList;

    /**
     * 方法的参数名称列表
     */
    private List<String> paramsNameList;

    /**
     * 注册成为接口的接口路径
     */
    private String path;

    public String getHandlerName() {
        return handlerName;
    }

    public HandlerDefinition setHandlerName(String handlerName) {
        this.handlerName = handlerName;
        return this;
    }

    public Class<?> getFactoryClass() {
        return factoryClass;
    }

    public HandlerDefinition setFactoryClass(Class<?> factoryClass) {
        this.factoryClass = factoryClass;
        return this;
    }

    public Method getMethod() {
        return method;
    }

    public HandlerDefinition setMethod(Method method) {
        this.method = method;
        return this;
    }

    public List<Class<?>> getParamsTypeList() {
        return paramsTypeList;
    }

    public HandlerDefinition setParamsTypeList(List<Class<?>> paramsTypeList) {
        this.paramsTypeList = paramsTypeList;
        return this;
    }

    public List<String> getParamsNameList() {
        return paramsNameList;
    }

    public HandlerDefinition setParamsNameList(List<String> paramsNameList) {
        this.paramsNameList = paramsNameList;
        return this;
    }

    public String getPath() {
        return path;
    }

    public HandlerDefinition setPath(String path) {
        this.path = path;
        return this;
    }
}
